<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">
var prcWin = new progressWin("${res}");//初始化遮罩层
var operate='${param.operate}';
$(document).ready(function(){
	$("#submit").click(function(){
		var title="";
		var action="";
		if(operate=='approve'){
	    	title="审核意见";
	    	action = "approvePrpList";
	    }else if(operate=="turnBack"){
	    	title="退回修改意见";
	    	action =  "return";
	    }else if(operate=="notpass"){
	    	title="不同意申报意见";
	    	action =  "notpass";
	    }
		var opn = $("#opinion").val();
		if(opn==null||opn==""){
			opn = $("#opinion").text();
		}
		if($.trim(opn).length==0){
			scmWarn("请输入"+title+"!");
			return false;
		}
		if(opn.length>500){
			scmWarn(title+"限500字内!");
			return false;
		}
		var options = {
				beforeSubmit : function() {
					$("#submit").attr("disabled",true);
					prcWin.openWin();//打开遮罩层
				}, // 表单提交前的回调函数
				success : function(msg) {
				if(msg=="操作成功!"){
					scmSuccess(msg);
					prcWin.closeWin();
					//parent.$("#searchBt").click();
					parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
					parent.currefresh=false;
					window.setTimeout("parent.tb_remove2()", 2000);
				}if(msg=="操作成功"){
					scmSuccess(msg);
					prcWin.closeWin();
					//parent.$("#searchBt").click();
					parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
					parent.currefresh=false;
					window.setTimeout("parent.tb_remove2()", 2000);
				}else{
					scmWarn(msg);
					prcWin.closeWin();
					parent.currefresh=false;
					window.setTimeout("parent.tb_remove2()", 2000);
				}
					
				
				},// 表单成功提交后的回调函数
				error : function() {
					scmError("操作失败,请联系系统管理员");
					prcWin.closeWin();
				},
				url: "${ctx}/prpapprove/"+action
			};
		$("#mainForm").ajaxSubmit(options);
	//	parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
		
	});
	$("#back").click(function(){
		//parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
		//parent.$("#searchBt").click();
		parent.tb_remove2();
	});
	//IE11无法获得焦点问题，暂行办法。
	setTimeout("$('#opinion').focus();",200);
	
});
</script>
</head>
<body>
	<form method="post" id="mainForm">
		<input type="hidden" name="prpCodes" value="${param.prpCodes}" />
		<input type="hidden" name="operate" value="${param.operate }" />
		<input type="hidden" name="status" value="${param.status }" />
		 <table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1">
	        <tr class="li_1">
	          <td width="100%"><textarea name="opinion" id="opinion" style="width:98%" rows="10" maxlength="500" onfocus="InitInput.setMaxLength(this,500)"></textarea></td>
	        </tr>
      	</table>
      	<br/>
      <div style="text-align: center;">
      	&nbsp;
      	<c:if test="${param.operate=='approve' }">
      		<security:authorize ifAnyGranted="A_PROPOSAL_AD_SUBMIT">
      			<input type="button" class="button_01" value="同意上报" id="submit"/>
     			</security:authorize>
     			<security:authorize ifAnyGranted="A_AUTH_TJBM,A_AUTH_ZGDW,A_AUTH_ADMIN,A_INFO_INSTITUTE">
     				<input type="button" class="button_01" value="审核通过" id="submit"/>
     			</security:authorize>
      	</c:if>
      	<c:if test="${param.operate=='turnBack' }">
      	<input type="button" class="button_01" value="退回修改" id="submit"/>
      	</c:if>
      	<c:if test="${param.operate=='notpass' }">
      	<input type="button" class="button_01" value="不同意申报" id="submit"/>
      	</c:if>
      	&nbsp;<input type="button" class="button_01" value="返回" id="back"/>
	  </div>
	</form>
</body>
</html>